β‘ESL v5.0.0 is out!β‘ (Migration Guide for ESL v4.*.*)
The ESL version 5.0.0 has just been released and comes with a lot of new features and improvements. This guide will help you to migrate your existing ESL v4.*.* project to ESL v5.0.0.
Preparation
We recommend that you consider using the ESL ESLint plugin to check your codebase for compatibility with ESL v5.0.0. It will help you to find and fix most of the issues before you start the migration process. The points not marked with π§ in the breaking changes section are covered by the ESLint plugin checks and could be fixed automatically.
Breaking Changes
-
Browser Support
ESL v5.0.0 no longer supports IE11 and ES5 target. ESL UI site renderer and ESL polyfills no longer support Edge old versions and ES6 polyfils. In case for some reason you still need to support IE11 or ES5 target you should use proper transpilation and polyfilling tools on your side.
-
ESL Core / ESL Utils
-
Direct imports changes
- π§
prop,attr,boolAttr,jsonAttr,listenare no longer available inesl-base-elementandesl-mixin-elementexports, to use them you should import them fromesl-utils/decoratorsdirectly or from the library root.
- π§
-
ESL Utils API Changes
Rectutility object is now immutable, so you can't change its properties directly. If you modify theRectobject trough builtin methods, you will get a new object with the updated properties.
-
ESL Utils Retired Functionality
DeviceDetector.TOUCH_EVENTSandTOUCH_EVENTSare retired from thedevice-detectormodule.- Note that the
DeviceDetectorclass is now deprecated. Use direct checks instead. createZIndexIframeandis-fixesmodule are no longer available due to drop of IE11 support.RTLUtilsandTraversingUtilsare retired. Use separate methods instead.- π§
TraversingQueryis retired as alias. UseESLTraversingQueryinstead. - π§
deepCompareis retired as alias. UseisEqualinstead. - π§
generateUIdis retired as alias. UserandUIDinstead. - π§
EventUtilsis retired as alias. UseESLEventUtilsinstead.
-
SynteticEventTargetAPI ChangesaddListenerandremoveListenershorthand are no longer supported. UseaddEventListenerandremoveEventListenerinstead.dispatchEventno longer accepts the target argument. You can override the target usingoverrideEventmethod fromesl-utils/dom/events.- π§
ESLEventUtils.descriptorsalias ofESLEventUtils.getAutoDescriptorsis no longer supported, use full method name instead.
-
ESL Media Query
- ESL Media Query consume functionality of
SynteticEventTargetsoaddListenerandremoveListenershorthand are no longer supported. UseaddEventListenerandremoveEventListenerinstead.
- ESL Media Query consume functionality of
-
-
ESL Toggleables and Triggers
-
ESL Toggleables API Changes
ToggleableActionParamsalias ofESLToggleableActionParamsis no longer supported.onBeforeShowandonBeforeHidehave retired. The constraint now insideshouldShow/shouldHidemethods. Note thatactivatorproperty change now is the part of main toggleable flow.this.openof Toggleables doesn't update until super.onShow/super.onHide is called. Make sure you updatethis.opensynchronously or manually notify consumers in case the super call ofonShow/onHideshould be postponed.
-
A11y improvements and focus management (affects ESlPopup)
a11yoption introduced and now used to control the focus management and a11y foresl-popup,esl-tooltip(footnotes),esl-share,esl-select(dropdown). Option available onESLToggleablelevel and controls focus flow and close on outside action feature.
-
ESL Triggers API Changes
ESLTriggerdoes not have target defined to::nextby default. You should always define the target explicitly.
-
ESL Panel and Panel Group
fallback-durationis no longer in the JSX shape ofESLPanelandESLPanelGroup.
-
ESL Popup
- Attribute
disable-arrowno longer supported. Use classdisable-arrowinstead.
- Attribute
-
-
ESL Footnotes
ESLNotenow based onESLBaseTriggerso active marker now calledactiveinstead oftooltip-shown.
-
ESL Image
- CSS aspect-ratio styles are no longer distributed with ESL Image. You should define them in your project styles or use a separate package for that.
- Note that ESL Image is now deprecated. Consider using native Image element with optional help from
esl-image-utilsmodule.
-
ESL Media
load-cls-target,load-cls-acceptedandload-cls-declineduseload-condition-classandload-condition-class-targetinstead.disabledmarker is no longer supported, uselazy="manual"instead (theforceoption ofplaymethod works the same way with the new lazy option).